package com.wgy.day14.ArrayList集合;

import java.util.ArrayList;
import java.util.Random;

/**
 * Created by pc on 2020/11/9 22:55
 * Description: LearningJava
 */
public class Demo06ArrayListRandom {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Random r = new Random();


        for (int i = 0; i < 6; i++) {
            int num = r.nextInt(33) + 1;
            //System.out.println(num);
            list.add(num);

        }
        System.out.println(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));

        }
    }
}
